<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="UIDUtil,mx.utils.UIDUtil,createUID,fromByteArray,getUID,isUID,toByteArray" name="keywords">
<title>mx.utils.UIDUtil</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'UIDUtil - Zentrum virtUOS: virtPresenter';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">virtPresenter AsDoc</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?mx/utils/UIDUtil.html&amp;mx/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;UIDUtil</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class UIDUtil"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class UIDUtil</td>
</tr>
</table>
<p></p>
  The UIDUtil class is an all-static class
  with methods for working with UIDs (unique identifiers) within Flex.
  You do not create instances of UIDUtil;
  instead you simply call static methods such as the
  <code>UIDUtil.createUID()</code> method.
 
  <p><b>Note</b>: If you have a dynamic object that has no [Bindable] properties 
  (which force the object to implement the IUID interface), Flex  adds an 
  <code>mx_internal_uid</code> property that contains a UID to the object. 
  To avoid having this field 
  in your dynamic object, make it [Bindable], implement the IUID interface
  in the object class, or set a <coded>uid</coded> property with a value.</p>
 <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#createUID()">createUID</a>():String</div>
<div class="summaryTableDescription">[static]
      Generates a UID (unique identifier) based on ActionScript's
      pseudo-random number generator and the current time.</div>
</td><td class="summaryTableOwnerCol">UIDUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#fromByteArray()">fromByteArray</a>(ba:ByteArray):String</div>
<div class="summaryTableDescription">[static]
     Converts a 128-bit UID encoded as a ByteArray to a String representation.</div>
</td><td class="summaryTableOwnerCol">UIDUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getUID()">getUID</a>(item:Object):String</div>
<div class="summaryTableDescription">[static]
      Returns the UID (unique identifier) for the specified object.</div>
</td><td class="summaryTableOwnerCol">UIDUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#isUID()">isUID</a>(uid:String):Boolean</div>
<div class="summaryTableDescription">[static]
     A utility method to check whether a String value represents a 
     correctly formatted UID value.</div>
</td><td class="summaryTableOwnerCol">UIDUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#toByteArray()">toByteArray</a>(uid:String):ByteArray</div>
<div class="summaryTableDescription">[static]
     Converts a UID formatted String to a ByteArray.</div>
</td><td class="summaryTableOwnerCol">UIDUtil</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="createUID()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">createUID</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function createUID():String</code><p>
      Generates a UID (unique identifier) based on ActionScript's
      pseudo-random number generator and the current time.
           </p><p>The UID has the form
      <code>"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"</code>
      where X is a hexadecimal digit (0-9, A-F).</p>
           <p>This UID will not be truly globally unique; but it is the best
      we can do without player support for UID generation.</p>
           <p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; The newly-generated UID.
     </td>
</tr>
</table>
</div>
<a name="fromByteArray()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">fromByteArray</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function fromByteArray(ba:ByteArray):String</code><p>
     Converts a 128-bit UID encoded as a ByteArray to a String representation.
     The format matches that generated by createUID. If a suitable ByteArray
     is not provided, null is returned.
     
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">ba</span>:ByteArray</code> &mdash; ByteArray 16 bytes in length representing a 128-bit UID.
     
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; String representation of the UID, or null if an invalid
     ByteArray is provided.
     </td>
</tr>
</table>
</div>
<a name="getUID()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getUID</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getUID(item:Object):String</code><p>
      Returns the UID (unique identifier) for the specified object.
      If the specified object doesn't have an UID
      then the method assigns one to it.
      If a map is specified this method will use the map
      to construct the UID.
      As a special case, if the item passed in is null,
      this method returns a null UID.
      
      </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">item</span>:Object</code> &mdash; Object that we need to find the UID for.
           </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>String</code> &mdash; The UID that was either found or generated.
     </td>
</tr>
</table>
</div>
<a name="isUID()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">isUID</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function isUID(uid:String):Boolean</code><p>
     A utility method to check whether a String value represents a 
     correctly formatted UID value. UID values are expected to be 
     in the format generated by createUID(), implying that only
     capitalized A-F characters in addition to 0-9 digits are
     supported.
     
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">uid</span>:String</code> &mdash; The value to test whether it is formatted as a UID.
     
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code> &mdash; Returns true if the value is formatted as a UID.
     </td>
</tr>
</table>
</div>
<a name="toByteArray()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">toByteArray</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function toByteArray(uid:String):ByteArray</code><p>
     Converts a UID formatted String to a ByteArray. The UID must be in the
     format generated by createUID, otherwise null is returned.
     
     </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">uid</span>:String</code> &mdash; representing a 128-bit UID
     
     </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>ByteArray</code> &mdash; ByteArray 16 bytes in length representing the 128-bits of the
     UID or null if the uid could not be converted.
     </td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
